package com.ruoyi.wechat.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.OnlineServiceMapper;
import com.ruoyi.wechat.domain.OnlineService;
import com.ruoyi.wechat.service.IOnlineServiceService;

/**
 * 在线客服消息表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-01
 */
@Service
public class OnlineServiceServiceImpl implements IOnlineServiceService 
{
    @Autowired
    private OnlineServiceMapper onlineServiceMapper;

    /**
     * 查询在线客服消息表
     * 
     * @param messageId 在线客服消息表主键
     * @return 在线客服消息表
     */
    @Override
    public OnlineService selectOnlineServiceByMessageId(String messageId)
    {
        return onlineServiceMapper.selectOnlineServiceByMessageId(messageId);
    }

    /**
     * 查询在线客服消息表列表
     * 
     * @param onlineService 在线客服消息表
     * @return 在线客服消息表
     */
    @Override
    public List<OnlineService> selectOnlineServiceList(OnlineService onlineService)
    {
        return onlineServiceMapper.selectOnlineServiceList(onlineService);
    }
    /**
     * 查询在线客服消息表列表
     *
     * @param userId 在线客服消息表
     * @return 在线客服消息表
     */
    public List<OnlineService> selectOnlineServiceListByUserId(String userId)
    {
        return onlineServiceMapper.selectOnlineServiceListByUserId(userId);
    }
    /**
     * 新增在线客服消息表
     * 
     * @param onlineService 在线客服消息表
     * @return 结果
     */
    @Override
    public int insertOnlineService(OnlineService onlineService)
    {
        onlineService.setMessageId(IdUtils.randomUUID());
        onlineService.setCreateTime(DateUtils.getNowDate());
        return onlineServiceMapper.insertOnlineService(onlineService);
    }


    /**
     * 修改在线客服消息表
     * 
     * @param onlineService 在线客服消息表
     * @return 结果
     */
    @Override
    public int updateOnlineService(OnlineService onlineService)
    {
        return onlineServiceMapper.updateOnlineService(onlineService);
    }

    /**
     * 批量删除在线客服消息表
     * 
     * @param messageIds 需要删除的在线客服消息表主键
     * @return 结果
     */
    @Override
    public int deleteOnlineServiceByMessageIds(String[] messageIds)
    {
        return onlineServiceMapper.deleteOnlineServiceByMessageIds(messageIds);
    }

    /**
     * 删除在线客服消息表信息
     * 
     * @param messageId 在线客服消息表主键
     * @return 结果
     */
    @Override
    public int deleteOnlineServiceByMessageId(String messageId)
    {
        return onlineServiceMapper.deleteOnlineServiceByMessageId(messageId);
    }
}
